<?php
include("include/config.inc.php");

$pageName = 'quenchingMedia';

if($_SESSION['s_userType'] == 'User')
{
   $authorization = "NoAccess";
   foreach($selUsermenuArr as $value)
   {
     if(in_array($pageName, $value))
       {
         $authorization ="Access";
         break;
       }
       else 
       {
        $authorization = "NoAccess";    
       }
   }
   if($authorization == "NoAccess")
   {
     header("location:index.php");
   }
}

$msg            = "Record Not Found";
$furArray = array();
if(isset($_POST['insertBtn']))
{
  $insertFur = "INSERT INTO quenchingmedia (qMName)
                      VALUE('".$_POST['qMName']."')";
  $insertFurResult = mysql_query($insertFur);
  if(!$insertFurResult)
    die("Insert Query Not Inserted : ".mysql_error());
  else
  {
    header("Location:quenchingMedia.php");
  }
}
$i = 0;
$selectFur = "SELECT qMId,qMName
                FROM quenchingmedia
            ORDER BY qMName";
$selectFurResult = mysql_query($selectFur);
while($furRow = mysql_fetch_array($selectFurResult))
{
	$furArray[$i]['qMId']     = $furRow['qMId'];
	$furArray[$i]['qMName']   = $furRow['qMName'];
	$i++;
}
include("./bottom.php");
$smarty->assign("furArray",$furArray);
$smarty->assign("msg",$msg);
$smarty->display('quenchingMedia.tpl');

?>